//
//  CropViewController.h
//  OpenGLGame
//
//  Created by Nguyen Cong Huy on 4/13/13.
//  Copyright (c) 2013 UIT. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "ImageActionBarView.h"
#import "CropView.h"

@protocol CropViewControllerDelegate;

@interface CropViewController : UIViewController <ImageActionBarViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, CropViewDelegate>{
  
    CropView* cropView;
    CGPoint                 oldLocation;
    
    ImageActionBarView* actionBarMenu;
    UIImagePickerController* imagePicker;

    
//    float scale;
    bool isCoverImage;
    bool isEnableCrop;
    UIImage* inputImg;
    CGRect cropRectInit;
    int stepRotate;
    
    id<CropViewControllerDelegate> delegate;
}

@property(nonatomic, readonly)  bool isEnableCrop;
@property (nonatomic, assign) id<CropViewControllerDelegate> delegate;
@property (nonatomic, retain) UIImage* inputImg;
@property (nonatomic, assign) CGRect cropRectInit;
@property (nonatomic, assign) int stepRotate;

-(void)addLabelCrop;
-(void)addNewActionBarMenu;
-(void)inputImage:(UIImage*)image;
-(void)inputImage:(UIImage*)image cropFrame:(CGRect)rect step:(int)step;
-(void)didChooseImageTap;
-(UIImage*)outputImage;

@end


@protocol CropViewControllerDelegate <NSObject>

@optional
- (void) didCropResultImage:(UIImage*)image cropRect:(CGRect)rect sender:(CropViewController*)sender;

@end